package com.aia.ilp.web.json;

import java.util.HashMap;
import java.util.Map;

import org.apache.log4j.Logger;
import org.apache.struts2.interceptor.SessionAware;

import com.opensymphony.xwork2.ActionSupport;

public class CustomerLogoutJson extends ActionSupport implements SessionAware {
	/**
	 * Logger for this class
	 */
	private static final Logger logger = Logger.getLogger(CustomerLogoutJson.class);

	private static final long serialVersionUID = 1L;
	private Map session;
	private Map root = new HashMap();

	public String execute() throws Exception {
		try {
			session.remove("customer");
			getRoot().put("success", new Boolean(true));
			return SUCCESS;
		} catch (Exception e) {
			logger.error("Customer logout error:+" + e, e);
			throw new RuntimeException(e);
		}
	}

	public void setSession(Map session) {
		this.session = session;
	}

	public void setRoot(Map root) {
		this.root = root;
	}

	public Map getRoot() {
		return root;
	}

}
